package com.mycompany.myapp.repository;

import com.mycompany.myapp.domain.Menu;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * Spring Data  repository for the Menu entity.
 */
@SuppressWarnings("unused")
@Repository
public interface MenuRepository extends JpaRepository<Menu, Long> {

    @Query("select m from Menu m where m.status = '1'")
    List<Menu> findAll();

    @Query("select m from Menu m where m.type like concat('%',?1,'%') and m.status = '1'")
    Page<Menu> findByParams(String cname, Pageable pageable);



}
